package com.monkeygroup.mygoplus.view.entrance.fragment;

/**
 * Created by cumt on 2017/3/12.
 */


import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.monkeygroup.mygoplus.R;

public class RegisterCompletefragment extends Fragment implements View.OnClickListener{
    private View mView;

    private Activity activity;
    //头部
    private TextView txtTitle;
    private ImageView imgBack;

    // Fragment管理对象
    private FragmentManager manager;
    private FragmentTransaction ft;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {

        activity = this.getActivity();
        manager = getFragmentManager();

        if (mView == null) {

            mView = inflater.inflate(R.layout.fragment_register_complete, container, false);


            initView();
            initListener();
        }
        return mView;
    }

    private void initView() {

        txtTitle =  (TextView)mView.findViewById(R.id.txt_title);
        txtTitle.setText("歡迎使用");
        imgBack =  (ImageView) mView.findViewById(R.id.img_back);


    }

    private void initListener() {

        mView.findViewById(R.id.btn_register_complete).setOnClickListener(this);
        imgBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                getFragmentManager().popBackStack();
            }
        });

    }


    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_register_complete:

//                MainActivity.gotoActivity(activity);
                activity.finish();
                break;

        }

    }
}
